//
//  TouchViewController.m
//  iOSCodeLearning
//
//  Created by TFAppleWork-Summer on 2018/4/18.
//  Copyright © 2018年 Ace. All rights reserved.
//

#import "TouchViewController.h"
#import "ReadView.h"
@interface TouchViewController ()

@end

/*
1 继承了UIResponder的对象是响应者对象（UIApplication UIViewController ,UIView）
 */
@implementation TouchViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.view.backgroundColor = [UIColor whiteColor];
    
    ReadView *redView = [[ReadView alloc]initWithFrame:CGRectMake(100, 100, 100, 100)];
    redView.backgroundColor = [UIColor redColor];
    [self.view addSubview:redView];
    
}

// UIResponder 内部提供了下面的方法来处理事件
// 触摸事件
// 一个或多个手指触摸屏幕
-(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{}
// 手指在屏幕上移动，该方法会持续在上面移动
-(void)touchesMoved:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{}
// 一个或者多个手指离开view
-(void)touchesEnded:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{}
// 触摸结束前，投个系统时间（例如电话呼入），会打断触摸过程
-(void)touchesCancelled:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{}

// 加速计事件
-(void)motionBegan:(UIEventSubtype)motion withEvent:(UIEvent *)event{}
-(void)motionEnded:(UIEventSubtype)motion withEvent:(UIEvent *)event{}
-(void)motionCancelled:(UIEventSubtype)motion withEvent:(UIEvent *)event{}

// 远程控制事件
-(void)remoteControlReceivedWithEvent:(UIEvent *)event{};

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
